php validate credit card expiration date

38

$expires = DateTime::createFromFormat('my', $_POST['expMonth'].$_POST['expYear']);
$now     = new DateTime();

if ($expires < $now) {
    echo 'Expired!';
}

Comments

Submit
0 Comments